# RUN: tf-mlir-translate -graphdef-to-mlir -tf-enable-shape-inference-on-import=false %s -o - | FileCheck %s

node {
  name: "unnamed"
  op: "foo"
  attr {
    key: "_output_shapes"
    value {
      list {
        shape {
        }
      }
    }
  }
  attr {
    key: "_disable_call_shape_inference"
    value {
      b: true
    }
  }
  experimental_debug_info {
  }
}
node {
  name: "unnamed1"
  op: "bar"
  experimental_debug_info {
  }
}
library {
  function {
    signature {
      name: "bar"
    }
  }
  function {
    signature {
      name: "foo"
    }
    node_def {
      name: "unnamed"
      op: "bar"
      experimental_debug_info {
        original_node_names: "unnamed"
      }
    }
  }
}
versions {
  producer: 29
  min_consumer: 12
}

# Verify that functions from the library are properly imported.

# CHECK-LABEL:  func @main() {
# CHECK:    "tf.LegacyCall"() {_disable_call_shape_inference = true, device = "", f = @foo0}
# CHECK:    "tf.LegacyCall"() {_disable_call_shape_inference = false, device = "", f = @bar0}

# CHECK-LABEL:  func private @foo0()
# CHECK: "tf.LegacyCall"() {_disable_call_shape_inference = false, device = "", f = @bar0}

# CHECK-LABEL:  func private @bar0()
